package de.se2.sharebox.classes;

import java.sql.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.TimeZone;

public class LogEntry
{
	private String message;
	private String source;
	private long timestamp;

	public LogEntry(String source, String message)
	{
		this.message = message;
		this.source = source;
		this.timestamp = System.currentTimeMillis();
	}

	public String getMessage()
	{
		return message;
	}

	public String getSource()
	{
		return source;
	}

	public String getDateFormatted()
	{
		DateFormat df = new SimpleDateFormat("HH:mm:ss");
		df.setTimeZone(TimeZone.getTimeZone("GMT+0"));

		return df.format(new Date(timestamp));
	}
}
